﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Default.Master" AutoEventWireup="true"
    CodeBehind="ViewSearchContact.aspx.cs" Inherits="MockPrjTeam1.Pages.Views.ViewSearchContact" %>

<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div id="templatemo_main">
        <div style="color: #000000; font-weight: bold">
            <br />
            <table class="tablesort">
                <tr>
                    <td class="style12">
                        FirstName
                    </td>
                    <td class="style12b">
                        <asp:TextBox ID="txtFirstName" runat="server" CssClass="textbox" TabIndex="1"></asp:TextBox>
                    </td>
                    <td class="style12">
                        SurName
                    </td>
                    <td class="style12b">
                        <asp:TextBox ID="txtSurName" runat="server" CssClass="textbox" TabIndex="2"></asp:TextBox>
                    </td>
                </tr>
            </table>
            <br />
            <table>
                <tr>
                    <td>
                        <asp:Button ID="btnSearchContact" Text="Search Contact" runat="server" Width="120px"
                            Height="25px" OnClick="btnSearchContact_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnClear" Text="Clear" runat="server" Width="65px" Height="25px"
                            OnClick="btnClear_Click" />
                    </td>
                    <td>
                        <asp:Button ID="btnCreate" Text="Create" runat="server" OnClick="btnCreate_Click"
                            Width="65px" Height="25px" />
                    </td>
                </tr>
            </table>
        </div>
        <asp:GridView ID="grvSearchContact" Width="800px" runat="server" AllowPaging="True"
            AutoGenerateColumns="False" Style="margin-top: 0px" ShowHeaderWhenEmpty="True"
            OnPageIndexChanging="grvSearchContact_PageIndexChanging" OnSelectedIndexChanged="grvSearchContact_SelectedIndexChanged"
            EnableModelValidation="True" 
            OnPageIndexChanged="grvSearchContact_SelectedIndexChanged" 
            DataKeyNames="ContactID" PageSize="5">
            <Columns>
                <asp:TemplateField HeaderText="">
                    <ItemTemplate>
                        <center>
                            <input type="radio" class="selectradio" id='<%# Eval("ContactID") %>' name='SuppliersGroup' value='<%# Eval("ContactName") %>'/></center>
                            
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="ContactName" HeaderText="Contact Name" SortExpression="ContactName">
                    <ControlStyle BorderColor="White" />
                    <FooterStyle BackColor="White" />
                </asp:BoundField>
                <asp:BoundField DataField="MobilePhone" HeaderText="Mobile Phone" SortExpression="MobilePhone" />
                <asp:BoundField DataField="EmailAddress" HeaderText="Email Address" SortExpression="EmailAddress" />
                <asp:BoundField DataField="ContactType" HeaderText="Contact Type" SortExpression="ContactType" />
                <asp:BoundField DataField="Active" HeaderText="Is Active" SortExpression="Active" />
            </Columns>
        </asp:GridView>
        <br />
        <table>
            <tr>
               
                <td>
               
                <input type='button' value='   Edit   ' onclick='getSelectedItem()' Width="85px" Height="25"  />
                   <%-- <asp:Button ID="btnEdit" Text="Edit" runat="server" Width="65px" Height="25" OnClick="btnEdit_Click" />--%>
                </td>
            </tr>
        </table>
    </div>
    <script type='text/javascript'>
        function getSelectedItem() {
            var radioes = document.getElementsByClassName('selectradio');
            for (var i = 0; i < radioes.length; i++) {
                if (radioes[i].checked) {
                    //alert(radioes[i].id,radioes[i].valueOf);
                    window.location = "../Forms/ContactDetail.aspx?id=" + radioes[i].id;
                }
            }
        }

        function getSelectedItem2() {
            var radioes = document.getElementsByClassName('selectradio');
            for (var i = 0; i < radioes.length; i++) {
                if (radioes[i].checked) {
                    //alert(radioes[i].id,radioes[i].valueOf);
                    window.location = "../Forms/ContactDetail.aspx?mid=" + radioes[i].id;
                }
            }
        }
</script>
</asp:Content>
